import { Get, Post, Delete } from "../server";
import { LoadingPost, LoadingGet, LoadingPut } from "../loadingServer";



export function StationGet(data) {
  return LoadingGet("/wms_pc/station/set", data);
}
export function TallyManageGet(data) {
  return LoadingGet("/wms_pc/tally/manage", data);
}
export function TallyManagePut(data) {
  return LoadingPut("/wms_pc/tally/manage", data);
}
export function TallyManagePost(data) {
  return LoadingPost("/wms_pc/tally/manage", data);
}
export function LoginPost(data) {
  return Post("/wms_pc/login", data);
}
export function TaskLocPost(data) {
  return Post("/wms_pc/stock/locationid/task", data);
}
export function CallEmptyGet(data) {
  return LoadingGet("/wms_pc/other/call/empty/info", data);
}
export function TaskLocGet(data) {
  return LoadingGet("/wms_pc/stock/locationid/task", data);
}
export function UserRolesGet(data) {
  return LoadingGet("/wms_pc/user/roles", data);
}
export function CallEmptyPut(data) {
  return LoadingPut("/wms_pc/other/call/empty/info", data);
}
export function StationPost(data) {
  return LoadingPost("/wms_pc/station/set", data);
}
export function UserRolesPost(data) {
  return LoadingPost("/wms_pc/user/roles", data);
}
export function StationPut(data) {
  return LoadingPut("/wms_pc/station/set", data);
}





export function getUserInfo(billId) {
  return Get("/biz/SRMOrder/GetDetail", { billId });
}
export function getBlockchangeWarning(data) {
  return Get("/gui/wcsz/v1/jdw/blockchange/warning", data);
}

// 查询产线--工位--投料点信息
export function getStationsPointsAPI(data) {
  return Get("/gui/wcsz/v1/productlines/points", data);
}
// /gui/wcsz/v1/productlines/points
// 查询指定工位托盘信息(精定位)
export function getJDWCidsInfoAPI(data) {
  return Get("/gui/wcsz/v1/jdw/cids/info", data);
}
// /gui/wcsz/v1/wcs_taskqueue
export function getWcsTaskQueueAPI(data) {
  return Get("/gui/wcsz/v1/wcs_taskqueue", data);
}
export function getCidsInfoAPI(data) {
  return Get("/gui/wcsz/v1/cids/info", data);
}
export function updatejdwBlockCidsAPI(data) {
  return Post("/gui/wcsz/v1/jdw/updateblock", data);
}

// 查询生产计划任务
export function getProduceplansAPI(data) {
  return Get("/gui/wcsz/v1/produceplans", data);
}
// 获取remoteurl
export function getRemoteurlAPI(data) {
  return Get("/gui/wcsz/v1/remoteurl", data);
}

// 查询生产计划任务
export function getLoadingProduceplansSortAPI(data) {
  return LoadingGet("/gui/wcsz/v1/produceplans/sort", data);
}

export function getProduceplansSortAPI(data) {
  return Get("/gui/wcsz/v1/produceplans/sort", data);
}

// 查询活跃的投料任务
export function getPointtasksAPI(data) {
  return Get("/gui/wcsz/v1/pointtasks", data);
}

// 查询工位操作记录
export function getScanInfoAPI(data) {
  return Get("/gui/wcsz/v1/scan/infos", data);
}

// 条码补打
export function getTlPointtasksAPI(data) {
  return Get("/gui/wcsz/v1/tl/pointtasks", data);
}

// 登录
export function loginAPI(data) {
  return Post("/gui/wcsz/v1/login", data);
}
// 禁用
export function stationSwitch(data) {
  return Post("/gui/wcsz/v1/station", data);
}

// planPullBreakupAPI
export function planPullBreakupAPI(data) {
  return Post("/gui/wcsz/v1/plan/pull/breakup", data);
}

// 托盘库位绑定
export function cidLocationBindAPI(data) {
  return Post("/gui/wcsz/v1/jdw/cid/locationid/bind", data);
}

// 关键件扫描完成
export function keyflagCompleteAPI(data) {
  return LoadingPost("/gui/wcsz/v1/keyflag/complete", data);
}

// 凸轮轴关键件扫描完成
export function keyflagCompleteTLZAPI(data) {
  return LoadingPost("/gui/wcsz/v1/tlz/keyflag/complete", data);
}

// 物料车关键件扫描完成
export function keyflagMCCompleteAPI(data) {
  return LoadingPost("/gui/wcsz/v1/mc/keyflag/complete", data);
}
// SPS物料车关键件扫描完成
export function keyflagSPSMCCompleteAPI(data) {
  return LoadingPost("/gui/wcsz/v1/SPS/mc/keyflag/complete", data);
}

// 关键件扫描完成修改
export function keyflagCompleteChangeAPI(data) {
  return LoadingPost("/gui/wcsz/v1/keyflag/complete/change", data);
}

// 关键件扫描跳过
export function keyflagSkiponeAPI(data) {
  return Post("/gui/wcsz/v1/keyflag/skipone", data);
}

// 关键件扫描跳过
export function keyflagSkiponeGKAPI(data) {
  return LoadingPost("/gui/wcsz/v1/pallet/bin/skip", data);
}

// 物料车关键件扫描跳过
export function keyflagMCSkiponeAPI(data) {
  // return LoadingPost("/gui/wcsz/v1/mc/keyflag/skipone", data);
  return Post("/gui/wcsz/v1/mc/keyflag/skipone", data);
}
// SPS物料车关键件扫描跳过
export function keyflagSPSMCSkiponeAPI(data) {
  return LoadingPost("/gui/wcsz/v1/SPS/mc/keyflag/skipone", data);
}
// 编辑关键件扫描跳过
export function keyflagSkiponeChangeAPI(data) {
  return LoadingPost("/gui/wcsz/v1/keyflag/skipone/change ", data);
}

// 非关键件下一步
export function unkeyflagNextstepAPI(data) {
  return LoadingPost("/gui/wcsz/v1/unkeyflag/nextstep", data);
}
// 物料车下一步
export function unkeyflagMCNextstepAPI(data) {
  return LoadingPost("/gui/wcsz/v1/mc/unkeyflag/nextstep", data);
}
// sps物料车下一步
export function unkeyflagSPSMCNextstepAPI(data) {
  return LoadingPost("/gui/wcsz/v1/SPS/mc/unkeyflag/nextstep", data);
}

// AB换面
export function ABchangeAPI(data) {
  return Post("/gui/wcsz/v1/pallet/operation", data);
}

// 退空投料点器具
export function cidEmpty(data) {
  return Post("/gui/wcsz/v1/cid/empty", data);
}

// 自动叫料架
export function EmptyCid(data) {
  return Post("/gui/wcsz/v1/mc/empty/cid", data);
}

// 工位托盘清空
export function delCidScan(data) {
  return Post("/gui/wcsz/v1/cid/scan/infos/delete", data);
}

// 工位托盘完成
export function cidFull(data) {
  return LoadingPost("/gui/wcsz/v1/cid/full", data);
}

// 输送线启停
export function Transit_PLC_API(data) {
  return LoadingPost("/Transit_PLC/", data);
}


// 物料车工位托盘完成
export function cidMCFull(data) {
  return LoadingPost("/gui/wcsz/v1/mc/cid/full", data);
}
// SPS物料车工位托盘完成
export function cidSPSMCFull(data) {
  return LoadingPost("/gui/wcsz/v1/SPS/mc/cid/full", data);
}
// 删除托盘
export function taskqueueDelAPI(data) {
  return LoadingPost("/gui/wcsz/v1/wcs_taskqueue/del", data);
}

// 物料车单层保存
export function scanMCSave(data) {
  return LoadingPost("/gui/wcsz/v1/som/scan/save", data);
}

// 投料激活
export function pointtasksActivationAPI(data) {
  return Post("/gui/wcsz/v1/pointtasks/activation", data);
}


// 投料激活
export function iwmscatlApi(data) {
  return Post("/iwmscatlApi/api/post?method=gz.wms.order.query&timestamp=2022-10-14+11%3a10%3a53&format=json&app_key=CATL&v=2.0&sign_method=md5&customerId=CATL&sign=BB8BF1A658461B075B7C0A3D2985EF05", data);
}



export const userApi = {
  StationGet,
  StationPost,
  StationPut,
  CallEmptyGet,
  CallEmptyPut,
  iwmscatlApi,
  getUserInfo,
  loginAPI,
  getStationsPointsAPI,
  getCidsInfoAPI,
  updatejdwBlockCidsAPI,
  cidLocationBindAPI,
  getProduceplansAPI,
  getProduceplansSortAPI,
  getLoadingProduceplansSortAPI,
  keyflagCompleteAPI,
  keyflagCompleteTLZAPI,
  keyflagMCCompleteAPI,
  keyflagSPSMCCompleteAPI,
  keyflagCompleteChangeAPI,
  keyflagSkiponeAPI,
  keyflagMCSkiponeAPI,
  keyflagSPSMCSkiponeAPI,
  keyflagSkiponeChangeAPI,
  keyflagSkiponeGKAPI,
  unkeyflagNextstepAPI,
  unkeyflagMCNextstepAPI,
  unkeyflagSPSMCNextstepAPI,
  getPointtasksAPI,
  ABchangeAPI,
  getScanInfoAPI,
  delCidScan,
  cidEmpty,
  EmptyCid,
  cidFull,
  cidMCFull,
  cidSPSMCFull,
  scanMCSave,
  pointtasksActivationAPI,
  planPullBreakupAPI,
  Transit_PLC_API,
  getJDWCidsInfoAPI,
  stationSwitch,
  getRemoteurlAPI,
  getTlPointtasksAPI,
  getBlockchangeWarning,
  getWcsTaskQueueAPI,
  taskqueueDelAPI,
  TallyManageGet,
  TallyManagePut,
  TallyManagePost,
  LoginPost,
  TaskLocGet,
  TaskLocPost,
  UserRolesGet,
  UserRolesPost
};

